﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
using System.Data;
using MINERP.MODEL.FoundationModel;

namespace MINERP.DAL.GenerateReports
{
    public class StatisticsDAL
    {
        public static string generateStatisticsReports(int orderProductid)
        {

            Database db = DatabaseFactory.CreateDatabase();

            DbCommand dbCommand = db.GetStoredProcCommand("SPStatisticsReport");
            db.AddInParameter(dbCommand, "@orderProductID", DbType.Int32, orderProductid);
            db.AddOutParameter(dbCommand, "@result", DbType.String, 50);
            db.ExecuteScalar(dbCommand);
            return db.GetParameterValue(dbCommand, "@result").ToString();

        }
    }
}
